doctype
html
  head
    meta(charset = "UTF-8")
    link(rel="icon" href="/test.jpg")
    link(rel="stylesheet", href="/index.css")
    script(src="/jquery.min.js")
    title nkm
    block style
  body
    include mixin
    block content
    script.
      function fade(txt){
        $('.message').text(txt)
        $('.message').animate({
          top:0
        })
        setTimeout(function(){
          $('.message').animate({
            top: '-100%'
          })
        },1500)
      }
      $(function () {
        $(".signout").click(function () {
          $.ajax({
            url: "/signout",
            type: "GET",
            cache: false,
            dataType: 'json',
            success: function (msg) {
              if (msg) {
                fade('登出成功')
                setTimeout(()=>{
                  window.location.href = "/posts"
              },1500)
              }
            },
            error: function () {
              alert('异常');
            }
          })
        })
      })
    block script